﻿<Window x:Class="SuplexApp.FileExportDlg"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Closing="Window_Closing"
    Title="Save (Secure)" Height="450" Width="800" MinHeight="450" MinWidth="600">

    <DockPanel Margin="10">
        <Grid DockPanel.Dock="Top" VerticalAlignment="Top">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>

            <Label Grid.Row="0" Grid.Column="0" Content="Filename:" Style="{DynamicResource DialogLabel}"/>
            <Grid Grid.Row="0" Grid.Column="1">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>
                <TextBox Style="{DynamicResource DialogTextBox}" Name="txtSaveFile" TextChanged="Something_Changed" />
                <Button Grid.Row="1" Grid.Column="1" Content="..." Margin="4,0,0,4"
                        Name="cmdBrowseSaveFile" Click="cmdBrowseSaveFile_Click"/>
            </Grid>

            <GroupBox Grid.Row="1" Grid.ColumnSpan="2" Margin="20,4,0,0" Padding="4">
                <GroupBox.Header>
                    <CheckBox Name="chkSignFile" Content="Sign the file"
                              Checked="Something_CheckChanged" Unchecked="Something_CheckChanged"/>
                </GroupBox.Header>
                <Grid IsEnabled="{Binding ElementName=chkSignFile, Path=IsChecked}">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition />
                        <RowDefinition />
                    </Grid.RowDefinitions>

                    <Grid Grid.Row="0" Grid.Column="1">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition />
                            <RowDefinition />
                        </Grid.RowDefinitions>

                        <Label Grid.Row="0" Grid.Column="0" Content="Asymmetric Keys File:" Style="{DynamicResource DialogLabel}" />
                        <TextBox Grid.Row="0" Grid.Column="1" Style="{DynamicResource DialogTextBox}"
                                 Name="txtKeysFile" TextChanged="Something_Changed" />
                        <Button Grid.Row="0" Grid.Column="2" Content="..." Margin="4,0,0,4" Name="cmdBrowseKeysFile" Click="cmdBrowseKeysFile_Click"/>

                        <Label Grid.Row="1" Grid.Column="0" Content="Key Container Name:" Style="{DynamicResource DialogLabel}" />
                        <TextBox Grid.Row="1" Grid.Column="1" Style="{DynamicResource DialogTextBox}"
                                 Name="txtKeysContainerName" TextChanged="Something_Changed" />
                    </Grid>

                    <Expander Grid.Row="1" Margin="20,4,0,0" Padding="4" Header="Generate Asymmetric Keys">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition />
                                <RowDefinition />
                                <RowDefinition />
                                <RowDefinition />
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>

                            <Label Grid.Row="0" Grid.Column="0" Content="Public/Private Key Pair File:" Style="{DynamicResource DialogLabel}" />
                            <TextBox Grid.Row="0" Grid.Column="1" Style="{DynamicResource DialogTextBox}" Name="txtPubPrivKeys" />
                            <Button Grid.Row="0" Grid.Column="2" Content="..." Margin="4,0,0,4"
                                    Name="cmdBrowsePubPriv" Click="cmdBrowsePubPriv_Click"/>

                            <Label Grid.Row="1" Grid.Column="0" Content="Public Key Only File:" Style="{DynamicResource DialogLabel}" />
                            <TextBox Grid.Row="1" Grid.Column="1" Style="{DynamicResource DialogTextBox}" Name="txtPubOnlyKey" />
                            <Button Grid.Row="1" Grid.Column="2" Content="..." Margin="4,0,0,4"
                                    Name="cmdBrowsePubOnly" Click="cmdBrowsePubOnly_Click"/>

                            <Label Grid.Row="2" Grid.Column="0" Content="Key Container Name:" Style="{DynamicResource DialogLabel}" />
                            <TextBox Grid.Row="2" Grid.Column="1" Style="{DynamicResource DialogTextBox}" Name="txtKeyPairContainerName" />

                            <Button Grid.Row="3" Grid.Column="1" HorizontalAlignment="Left" Content="Generate Asymmetric Keys"
                                    Name="cmdGenerateKeys" Click="cmdGenerateKeys_Click"/>
                        </Grid>
                    </Expander>
                </Grid>
            </GroupBox>

            <GroupBox Grid.Row="2" Grid.ColumnSpan="2" Margin="20,4,0,0" Padding="4" Name="grpExportOptions" Header="Export Options" Visibility="Collapsed">
                <StackPanel>
                    <RadioButton Content="Export Validation and Security" Margin="4,4,0,0" Name="chkExportAll" IsChecked="True" />
                    <RadioButton Content="Export Validation Only" Margin="4,4,0,0" Name="chkExportValidation" />
                    <RadioButton Content="Export Security Only" Margin="4,4,0,4" Name="chkExportSecurity" />
                </StackPanel>
            </GroupBox>
        </Grid>

        <StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal"
                    VerticalAlignment="Bottom" HorizontalAlignment="Right">
            <Button Content="Save" Margin="0,0,10,0" Name="cmdSave" Click="cmdSave_Click" IsEnabled="False" IsDefault="True"/>
            <Button Content="Cancel" Name="cmdCancel" Click="cmdCancel_Click" IsCancel="True"/>
        </StackPanel>
    </DockPanel>
</Window>